@import '@/styles/utils.scss';

.preview {
  width: 100%;
  height: 100%;
  background: #FFFFFF;
  box-shadow: 0px 0px 40px 0px #EBEBEB;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.3s;

  :global(.dark) & {
    background: #292A2E;
    box-shadow: none;
    border: 1px solid #3F3F46;
  }

  .container {
    position: relative;
    flex: 1;
    .body {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      overflow: auto;
      padding: 16px;
      // width: 657px;
      
      :global(.dark) & {
        color: #E4E4E7; // Lighter text color for dark mode
        background-color: #292A2E; // Match the parent background
      }
    }
  }
}

.previewOpen {
  width: 50%;
  transition: all 0.3s;
  animation: expand 0.3s ease forwards;
}

@keyframes expand {
  to {
    width: 100%;
  }
}

.headerTop {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  
  border-bottom: 1px solid #F1F1F1;
  // height: 48px;
  background-color:#F5F5F5;
  border-radius: 16px 16px 0px 0px;

  :global(.dark) & {
    border-bottom: 1px solid #3F3F46;
    background-color:#292A2E;
  }
}

.tabsRoot {
  flex: 1;
}

.tabsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.tabsList {
  display: flex;
  gap: 8px;
}

.tabsTrigger {
  all: unset;
  padding: 0 4px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #71717A;
  border-radius: 16px;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
  line-height: 1;
  min-width: 80px;
  border: 1px solid transparent;

  &:hover {
    background-color: #444444;
    color: #fff;
  }

  &[data-state='active'] {
    color: #fff;
    font-weight: 500;
    background-color: #151515;
  }

  :global(.dark) & {
    color: #A1A1AA;

    &:hover {
      background-color: #313234;
    }

    &[data-state='active'] {
      color: #FFFFFF;
      background-color: #3F4043;
      border: 1px solid #3F4245;
    }
  }
}

.tabsActions {
  display: flex;
  gap: 8px;
}

.actionButton {
  all: unset;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 30px;
  font-size: 14px;
  color: #333333;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #FFFFFF;
  border: 1px solid #E6E6E6;
  margin-right: 10px;
  min-width: 120px;
  justify-content: center;
  font-weight: 500;
  
  i {
    font-size: 16px;
  }

  &:hover {
    background-color: #F5F5F5;
    border-color: #D1D1D1;
  }
  
  &.actionButtonActive {
    background-color: #151515;
    color: white;
    border-color: #151515;
    
    &:hover {
      background-color: #2C2C2C;
    }
  }

  :global(.dark) & {
    color: #E4E4E7;
    background-color: #313234;
    border: 1px solid #3F3F46;

    &:hover {
      background-color: #3F4043;
      border-color: #52525B;
    }
    
    &.actionButtonActive {
      background-color: #151515;
      color: white;
      border-color: #151515;
      
      &:hover {
        background-color: #151515;
        border-color: #151515;
      }
    }
  }
}


.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #71717A;

  :global(.dark) & {
    color: #A1A1AA;
  }
}

.paginationButton {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s;

  &:hover {
    background-color: #F5F5F5;
  }

  :global(.dark) & {
    &:hover {
      background-color: #27272A;
    }
  }
}

.content{
  border-radius: 0px 0px 16px 16px;
  position: relative;
  :global(.dark) & {
    background-color: #292A2E;
  }
}

.item{
  margin-bottom: 24px;
  background-color: #FFFFFF;
  border-radius: 16px;
  overflow: hidden;
  
  :global(.dark) & {
    background-color: #292A2E;
    border: 1px solid #3F3F46;
  }
}

.code{
  height: 410px;
  
  :global(.dark) & {
    background-color: #1E1E20;
  }
}


.options{
  position: absolute;
  right: 24px;
  top: 24px;
  z-index: 10;
}

.button1 {
  all: unset;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #FFFFFF;
  padding: 0px 10px;
  min-width: 100px;
  height: 32px;
  line-height: 1;
  border-radius: 8px;
  border: 1px solid #E3E3E3;
  font-size: 12px;
  color: #353535;

  &:disabled {
    cursor: not-allowed;
    opacity: 0.5;
  }

  &:hover {
    background: #F3F3F3;
  }


  :global(.dark) & {
    color: #d1d5db;
    border-color: #3F4245;
    background-color: transparent;

    &:hover {
      background: #313234;
    }
  }
}